import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * 任务记录
 */
@Entity('task_record')
export class TaskRecordEntity extends BaseEntity {
  @Index()
  @Column({ comment: '任务ID' })
  jobId: number;

  @Index()
  @Column({ comment: 'Topic' })
  topic: string;

  @Index()
  @Column({ comment: '应用ID' })
  appId: number;

  @Column({ comment: '状态 0-执行中 1-成功 2-失败', default: 0 })
  status: number;

  @Column({ comment: '结果', type: 'text', nullable: true })
  result: string;

  @Column({ comment: '结果时间', nullable: true })
  resultTime: Date;
}
